Convert GailMenuShell to GtkMenuShellAccessible
authorMatthias Clasen <mclasen@redhat.com>
Sat, 2 Jul 2011 02:42:25 +0000 (22:42 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 5 Jul 2011 20:08:57 +0000 (16:08 -0400)
gtk/a11y/Makefile.am
gtk/a11y/gail.c
gtk/a11y/gailmenushell.c [deleted file]
gtk/a11y/gailmenushell.h [deleted file]
gtk/a11y/gtkmenuaccessible.c
gtk/a11y/gtkmenuaccessible.h
gtk/a11y/gtkmenushellaccessible.c [new file with mode: 0644]
gtk/a11y/gtkmenushellaccessible.h [new file with mode: 0644]
gtk/gtkmenubar.c

index 5a9724b99bfd6de3e16fc7ca8ad210d390b9be5e..031fb4956a6a3f079177c158a1484b23d5fb7965 100644 (file)
@@ -24,7 +24,7 @@ gail_c_sources =                      \
        gtklinkbuttonaccessible.c       \
        gailmisc.c                      \
        gtkmenuaccessible.c             \
-       gailmenushell.c                 \
+       gtkmenushellaccessible.c        \
        gtkmenuitemaccessible.c         \
        gtknotebookaccessible.c         \
        gtknotebookpageaccessible.c     \
@@ -76,7 +76,7 @@ gail_private_h_sources =              \
        gtklinkbuttonaccessible.h       \
        gailmisc.h                      \
        gtkmenuaccessible.h             \
-       gailmenushell.h                 \
+       gtkmenushellaccessible.h        \
        gtkmenuitemaccessible.h         \
        gtknotebookaccessible.h         \
        gtknotebookpageaccessible.h     \
index 1c2a54dadc61d466ee2d5236d7e6a844dd9bbcfd..00110641535b221d9ae7d4b93dec2622dbee18e1 100644 (file)
@@ -28,7 +28,6 @@
 #include "gailcontainer.h"
 #include "gailcontainercell.h"
 #include "gailimagecell.h"
-#include "gailmenushell.h"
 #include "gailrenderercell.h"
 #include "gailtextcell.h"
 #include "gailtoplevel.h"
@@ -81,7 +80,6 @@ static GQuark quark_focus_object = 0;
 
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WIDGET, GailWidget, gail_widget, GTK_TYPE_WIDGET)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CONTAINER, GailContainer, gail_container, GTK_TYPE_CONTAINER)
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU_SHELL, GailMenuShell, gail_menu_shell, GTK_TYPE_MENU_SHELL)
 GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_RENDERER_CELL, GailRendererCell, gail_renderer_cell, GTK_TYPE_CELL_RENDERER, gail_renderer_cell_new)
 GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_BOOLEAN_CELL, GailBooleanCell, gail_boolean_cell, GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell_new)
 GAIL_IMPLEMENT_FACTORY_WITH_FUNC_DUMMY (GAIL_TYPE_IMAGE_CELL, GailImageCell, gail_image_cell, GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell_new)
@@ -828,7 +826,6 @@ gail_accessibility_module_init (void)
 
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_WIDGET, gail_widget);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CONTAINER, gail_container);
-  GAIL_WIDGET_SET_FACTORY (GTK_TYPE_MENU_BAR, gail_menu_shell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TEXT, gail_text_cell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_TOGGLE, gail_boolean_cell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell);
diff --git a/gtk/a11y/gailmenushell.c b/gtk/a11y/gailmenushell.c
deleted file mode 100644 (file)
index 7d87df5..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include "gailmenushell.h"
-
-static void         gail_menu_shell_class_init          (GailMenuShellClass *klass);
-static void         gail_menu_shell_init                (GailMenuShell      *menu_shell);
-static void         gail_menu_shell_initialize          (AtkObject          *accessible,
-                                                         gpointer            data);
-static void         atk_selection_interface_init        (AtkSelectionIface  *iface);
-static gboolean     gail_menu_shell_add_selection       (AtkSelection   *selection,
-                                                         gint           i);
-static gboolean     gail_menu_shell_clear_selection     (AtkSelection   *selection);
-static AtkObject*   gail_menu_shell_ref_selection       (AtkSelection   *selection,
-                                                         gint           i);
-static gint         gail_menu_shell_get_selection_count (AtkSelection   *selection);
-static gboolean     gail_menu_shell_is_child_selected   (AtkSelection   *selection,
-                                                         gint           i);
-static gboolean     gail_menu_shell_remove_selection    (AtkSelection   *selection,
-                                                         gint           i);
-
-G_DEFINE_TYPE_WITH_CODE (GailMenuShell, gail_menu_shell, GAIL_TYPE_CONTAINER,
-                         G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
-
-static void
-gail_menu_shell_class_init (GailMenuShellClass *klass)
-{
-  AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
-
-  atk_object_class->initialize = gail_menu_shell_initialize;
-}
-
-static void
-gail_menu_shell_init (GailMenuShell *menu_shell)
-{
-}
-
-static void
-gail_menu_shell_initialize (AtkObject *accessible,
-                            gpointer  data)
-{
-  ATK_OBJECT_CLASS (gail_menu_shell_parent_class)->initialize (accessible, data);
-
-  if (GTK_IS_MENU_BAR (data))
-    accessible->role = ATK_ROLE_MENU_BAR;
-  else
-    /*
-     * Accessible object for Menu is created in gailmenu.c
-     */
-    accessible->role = ATK_ROLE_UNKNOWN;
-}
-
-static void
-atk_selection_interface_init (AtkSelectionIface *iface)
-{
-  iface->add_selection = gail_menu_shell_add_selection;
-  iface->clear_selection = gail_menu_shell_clear_selection;
-  iface->ref_selection = gail_menu_shell_ref_selection;
-  iface->get_selection_count = gail_menu_shell_get_selection_count;
-  iface->is_child_selected = gail_menu_shell_is_child_selected;
-  iface->remove_selection = gail_menu_shell_remove_selection;
-  /*
-   * select_all_selection does not make sense for a menu_shell
-   * so no implementation is provided.
-   */
-}
-
-static gboolean
-gail_menu_shell_add_selection (AtkSelection *selection,
-                               gint          i)
-{
-  GList *kids;
-  GtkWidget *item;
-  guint length;
-  GtkWidget *widget;
-
-  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
-  if (widget == NULL)
-  {
-    /* State is defunct */
-    return FALSE;
-  }
-
-  kids = gtk_container_get_children (GTK_CONTAINER (widget));
-  length = g_list_length (kids);
-  if (i < 0 || i > length)
-    {
-      g_list_free (kids);
-      return FALSE;
-    }
-
-  item = g_list_nth_data (kids, i);
-  g_list_free (kids);
-  g_return_val_if_fail (GTK_IS_MENU_ITEM(item), FALSE);
-  gtk_menu_shell_select_item (GTK_MENU_SHELL (widget), item);
-  return TRUE;
-}
-
-static gboolean
-gail_menu_shell_clear_selection (AtkSelection   *selection)
-{
-  GtkMenuShell *shell;
-  GtkWidget *widget;
-
-  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
-  if (widget == NULL)
-  {
-    /* State is defunct */
-    return FALSE;
-  }
-
-  shell = GTK_MENU_SHELL (widget);
-
-  gtk_menu_shell_deselect (shell);
-  return TRUE;
-}
-
-static AtkObject*
-gail_menu_shell_ref_selection (AtkSelection   *selection,
-                               gint           i)
-{
-  GtkMenuShell *shell;
-  AtkObject *obj;
-  GtkWidget *widget;
-  GtkWidget *item;
-
-  if (i != 0)
-    return NULL;
-
-  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
-  if (widget == NULL)
-  {
-    /* State is defunct */
-    return NULL;
-  }
-
-  shell = GTK_MENU_SHELL (widget);
-
-  item = gtk_menu_shell_get_selected_item (shell);
-  if (item != NULL)
-  {
-    obj = gtk_widget_get_accessible (item);
-    g_object_ref (obj);
-    return obj;
-  }
-  else
-  {
-    return NULL;
-  }
-}
-
-static gint
-gail_menu_shell_get_selection_count (AtkSelection   *selection)
-{
-  GtkMenuShell *shell;
-  GtkWidget *widget;
-
-  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
-  if (widget == NULL)
-  {
-    /* State is defunct */
-    return 0;
-  }
-
-  shell = GTK_MENU_SHELL (widget);
-
-  /*
-   * Identifies the currently selected menu item
-   */
-  if (gtk_menu_shell_get_selected_item (shell) == NULL)
-  {
-    return 0;
-  }
-  else
-  {
-    return 1;
-  }
-}
-
-static gboolean
-gail_menu_shell_is_child_selected (AtkSelection   *selection,
-                                   gint           i)
-{
-  GtkMenuShell *shell;
-  GList *kids;
-  gint j;
-  GtkWidget *widget;
-  GtkWidget *item;
-
-  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
-  if (widget == NULL)
-  {
-    /* State is defunct */
-    return FALSE;
-  }
-
-  shell = GTK_MENU_SHELL (widget);
-  item = gtk_menu_shell_get_selected_item (shell);
-  if (item == NULL)
-    return FALSE;
-
-  kids = gtk_container_get_children (GTK_CONTAINER (shell));
-  j = g_list_index (kids, item);
-  g_list_free (kids);
-
-  return (j==i);
-}
-
-static gboolean
-gail_menu_shell_remove_selection (AtkSelection   *selection,
-                                  gint           i)
-{
-  GtkMenuShell *shell;
-  GtkWidget *widget;
-  GtkWidget *item;
-
-  if (i != 0)
-    return FALSE;
-
-  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
-  if (widget == NULL)
-  {
-    /* State is defunct */
-    return FALSE;
-  }
-
-  shell = GTK_MENU_SHELL (widget);
-
-  item = gtk_menu_shell_get_selected_item (shell);
-  if (item && gtk_menu_item_get_submenu (GTK_MENU_ITEM (item)))
-  {
-    /*
-     * Menu item contains a menu and it is the selected menu item
-     * so deselect it.
-     */
-    gtk_menu_shell_deselect (shell);
-  }
-  return TRUE;
-}
diff --git a/gtk/a11y/gailmenushell.h b/gtk/a11y/gailmenushell.h
deleted file mode 100644 (file)
index 07b8516..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_MENU_SHELL_H__
-#define __GAIL_MENU_SHELL_H__
-
-#include "gailcontainer.h"
-
-G_BEGIN_DECLS
-
-#define GAIL_TYPE_MENU_SHELL                    (gail_menu_shell_get_type ())
-#define GAIL_MENU_SHELL(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_MENU_SHELL, GailMenuShell))
-#define GAIL_MENU_SHELL_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_MENU_SHELL, GailMenuShellClass))
-#define GAIL_IS_MENU_SHELL(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_MENU_SHELL))
-#define GAIL_IS_MENU_SHELL_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_MENU_SHELL))
-#define GAIL_MENU_SHELL_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_MENU_SHELL, GailMenuShellClass))
-
-typedef struct _GailMenuShell                   GailMenuShell;
-typedef struct _GailMenuShellClass              GailMenuShellClass;
-
-struct _GailMenuShell
-{
-  GailContainer parent;
-};
-
-GType gail_menu_shell_get_type (void);
-
-struct _GailMenuShellClass
-{
-  GailContainerClass parent_class;
-};
-
-G_END_DECLS
-
-#endif /* __GAIL_MENU_SHELL_H__ */
index 1a16318e16f0b120afd81d450d78868a9a09e378..648b9d35cdc7be9a6a2794ea688a7f9172a86f7e 100644 (file)
@@ -22,7 +22,7 @@
 #include "gtkmenuaccessible.h"
 
 
-G_DEFINE_TYPE (GtkMenuAccessible, gtk_menu_accessible, GAIL_TYPE_MENU_SHELL)
+G_DEFINE_TYPE (GtkMenuAccessible, gtk_menu_accessible, GTK_TYPE_MENU_SHELL_ACCESSIBLE)
 
 static void
 gtk_menu_accessible_initialize (AtkObject *obj,
index fe8eabe1659472f32a6342656f6f41064bbd0512..341a7bea5be9b19fe1c0db3b10eb8bbf7e5523c9 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef __GTK_MENU_ACCESSIBLE_H__
 #define __GTK_MENU_ACCESSIBLE_H__
 
-#include "gailmenushell.h"
+#include "gtkmenushellaccessible.h"
 
 G_BEGIN_DECLS
 
@@ -36,12 +36,12 @@ typedef struct _GtkMenuAccessibleClass GtkMenuAccessibleClass;
 
 struct _GtkMenuAccessible
 {
-  GailMenuShell parent;
+  GtkMenuShellAccessible parent;
 };
 
 struct _GtkMenuAccessibleClass
 {
-  GailMenuShellClass parent_class;
+  GtkMenuShellAccessibleClass parent_class;
 };
 
 GType gtk_menu_accessible_get_type (void);
diff --git a/gtk/a11y/gtkmenushellaccessible.c b/gtk/a11y/gtkmenushellaccessible.c
new file mode 100644 (file)
index 0000000..1381523
--- /dev/null
@@ -0,0 +1,204 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+#include "gtkmenushellaccessible.h"
+
+
+static void atk_selection_interface_init (AtkSelectionIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (GtkMenuShellAccessible, gtk_menu_shell_accessible, GAIL_TYPE_CONTAINER,
+                         G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
+
+static void
+gtk_menu_shell_accessible_initialize (AtkObject *accessible,
+                                      gpointer   data)
+{
+  ATK_OBJECT_CLASS (gtk_menu_shell_accessible_parent_class)->initialize (accessible, data);
+
+  if (GTK_IS_MENU_BAR (data))
+    accessible->role = ATK_ROLE_MENU_BAR;
+  else
+    accessible->role = ATK_ROLE_UNKNOWN;
+}
+
+static void
+gtk_menu_shell_accessible_class_init (GtkMenuShellAccessibleClass *klass)
+{
+  AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass);
+
+  atk_object_class->initialize = gtk_menu_shell_accessible_initialize;
+}
+
+static void
+gtk_menu_shell_accessible_init (GtkMenuShellAccessible *menu_shell)
+{
+}
+
+static gboolean
+gtk_menu_shell_accessible_add_selection (AtkSelection *selection,
+                                         gint          i)
+{
+  GList *kids;
+  GtkWidget *item;
+  guint length;
+  GtkWidget *widget;
+
+  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
+  if (widget == NULL)
+    return FALSE;
+
+  kids = gtk_container_get_children (GTK_CONTAINER (widget));
+  length = g_list_length (kids);
+  if (i < 0 || i > length)
+    {
+      g_list_free (kids);
+      return FALSE;
+    }
+
+  item = g_list_nth_data (kids, i);
+  g_list_free (kids);
+  g_return_val_if_fail (GTK_IS_MENU_ITEM (item), FALSE);
+  gtk_menu_shell_select_item (GTK_MENU_SHELL (widget), item);
+  return TRUE;
+}
+
+static gboolean
+gtk_menu_shell_accessible_clear_selection (AtkSelection *selection)
+{
+  GtkMenuShell *shell;
+  GtkWidget *widget;
+
+  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
+  if (widget == NULL)
+    return FALSE;
+
+  shell = GTK_MENU_SHELL (widget);
+
+  gtk_menu_shell_deselect (shell);
+  return TRUE;
+}
+
+static AtkObject *
+gtk_menu_shell_accessible_ref_selection (AtkSelection *selection,
+                                         gint          i)
+{
+  GtkMenuShell *shell;
+  AtkObject *obj;
+  GtkWidget *widget;
+  GtkWidget *item;
+
+  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
+  if (widget == NULL)
+    return NULL;
+
+  if (i != 0)
+    return NULL;
+
+  shell = GTK_MENU_SHELL (widget);
+
+  item = gtk_menu_shell_get_selected_item (shell);
+  if (item != NULL)
+    {
+      obj = gtk_widget_get_accessible (item);
+      g_object_ref (obj);
+      return obj;
+    }
+  return NULL;
+}
+
+static gint
+gtk_menu_shell_accessible_get_selection_count (AtkSelection *selection)
+{
+  GtkMenuShell *shell;
+  GtkWidget *widget;
+
+  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
+  if (widget == NULL)
+    return 0;
+
+  shell = GTK_MENU_SHELL (widget);
+
+  if (gtk_menu_shell_get_selected_item (shell) != NULL)
+    return 1;
+
+  return 0;
+}
+
+static gboolean
+gtk_menu_shell_accessible_is_child_selected (AtkSelection *selection,
+                                             gint          i)
+{
+  GtkMenuShell *shell;
+  GList *kids;
+  gint j;
+  GtkWidget *widget;
+  GtkWidget *item;
+
+  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
+  if (widget == NULL)
+    return FALSE;
+
+  shell = GTK_MENU_SHELL (widget);
+  item = gtk_menu_shell_get_selected_item (shell);
+  if (item == NULL)
+    return FALSE;
+
+  kids = gtk_container_get_children (GTK_CONTAINER (shell));
+  j = g_list_index (kids, item);
+  g_list_free (kids);
+
+  return j==i;
+}
+
+static gboolean
+gtk_menu_shell_accessible_remove_selection (AtkSelection *selection,
+                                            gint          i)
+{
+  GtkMenuShell *shell;
+  GtkWidget *widget;
+  GtkWidget *item;
+
+  widget =  gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
+  if (widget == NULL)
+    return FALSE;
+
+  if (i != 0)
+    return FALSE;
+
+  shell = GTK_MENU_SHELL (widget);
+
+  item = gtk_menu_shell_get_selected_item (shell);
+  if (item && gtk_menu_item_get_submenu (GTK_MENU_ITEM (item)))
+    gtk_menu_shell_deselect (shell);
+  return TRUE;
+}
+
+static void
+atk_selection_interface_init (AtkSelectionIface *iface)
+{
+  iface->add_selection = gtk_menu_shell_accessible_add_selection;
+  iface->clear_selection = gtk_menu_shell_accessible_clear_selection;
+  iface->ref_selection = gtk_menu_shell_accessible_ref_selection;
+  iface->get_selection_count = gtk_menu_shell_accessible_get_selection_count;
+  iface->is_child_selected = gtk_menu_shell_accessible_is_child_selected;
+  iface->remove_selection = gtk_menu_shell_accessible_remove_selection;
+}
diff --git a/gtk/a11y/gtkmenushellaccessible.h b/gtk/a11y/gtkmenushellaccessible.h
new file mode 100644 (file)
index 0000000..265b74e
--- /dev/null
@@ -0,0 +1,51 @@
+/* GAIL - The GNOME Accessibility Implementation Library
+ * Copyright 2001 Sun Microsystems Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GTK_MENU_SHELL_ACCESSIBLE_H__
+#define __GTK_MENU_SHELL_ACCESSIBLE_H__
+
+#include "gailcontainer.h"
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_MENU_SHELL_ACCESSIBLE                    (gtk_menu_shell_accessible_get_type ())
+#define GTK_MENU_SHELL_ACCESSIBLE(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_SHELL_ACCESSIBLE, GtkMenuShellAccessible))
+#define GTK_MENU_SHELL_ACCESSIBLE_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_SHELL_ACCESSIBLE, GtkMenuShellAccessibleClass))
+#define GTK_IS_MENU_SHELL_ACCESSIBLE(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_SHELL_ACCESSIBLE))
+#define GTK_IS_MENU_SHELL_ACCESSIBLE_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_SHELL_ACCESSIBLE))
+#define GTK_MENU_SHELL_ACCESSIBLE_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_SHELL_ACCESSIBLE, GtkMenuShellAccessibleClass))
+
+typedef struct _GtkMenuShellAccessible      GtkMenuShellAccessible;
+typedef struct _GtkMenuShellAccessibleClass GtkMenuShellAccessibleClass;
+
+struct _GtkMenuShellAccessible
+{
+  GailContainer parent;
+};
+
+struct _GtkMenuShellAccessibleClass
+{
+  GailContainerClass parent_class;
+};
+
+GType gtk_menu_shell_accessible_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GTK_MENU_SHELL_ACCESSIBLE_H__ */
index c54bc79244be6778f100cc5f278d2530d213d880..4c419498a80be458be665084c9a7154f4442365e 100644 (file)
@@ -52,6 +52,7 @@
 #include "gtkintl.h"
 #include "gtkprivate.h"
 #include "gtktypebuiltins.h"
+#include "a11y/gtkmenushellaccessible.h"
 
 #define BORDER_SPACING  0
 #define DEFAULT_IPADDING 1
@@ -229,6 +230,8 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class)
                                                              GTK_PARAM_READABLE));
 
   g_type_class_add_private (gobject_class, sizeof (GtkMenuBarPrivate));
+
+  gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_MENU_SHELL_ACCESSIBLE);
 }
 
 static void